<template>
  <div class="mb70 container min-height">
    <p class="bread">
      <a href="#/index/lawyer-msg-manage" class="font-s-18">律师信息管理</a> >
      <a href="javascript:void(0);" class="font-s-16">详情</a>
    </p>
    <div class="bg-c-fff box-border">
      <h2 class="box-title rel">律师信息管理>详情</a></h2>
      <form @submit.prevent="onSubmitBtn">
        <ul>
          <li>
            <span>律师姓名：</span>
            <p class="dib p">{{lawyerName}}</p>
          </li>
          <li>
            <span>律师姓别：</span>
            <p class="dib p">{{six}}</p>
          </li>
          <li>
            <span>律师照片：</span>
            <div class="preview-box">
              <div class="preview" v-if="photoUrl===''">
                <div class="db auto tc">待上传</div>
              </div>
              <div class="preview-img" v-else>
                <img :src="photoUrl">
              </div>
            </div>
          </li>
          <li>
            <span>联系电话：</span>
            <p class="dib p">{{phone}}</p>
          </li>
          <li>
            <span>办公地址：</span>
            <p class="dib p">{{province}}</p>
            <p class="dib p">{{state}}</p>
            <p class="dib p">{{area}}</p>
          </li>
          <li>
            <span>所属律所：</span>
            <p class="dib p">{{lawfirmName}}</p>
          </li>
          <li>
            <span>执业年限：</span>
            <p class="dib p">{{year}}</p>
          </li>
          <li>
            <span class="field-label">擅长领域：</span>
            <div class="field-box">
              <div class="field-item">
               <div class="p">{{cA}}</div> 
               <div class="p">{{cB}}</div> 
               <div class="p">{{cC}}</div> 
              </div>
            </div>
          </li>
          <li>
            <span>个人简介：</span>
            <p class="dib p">{{individualResume}}</p>
          </li>
        </ul>
      </form>
    </div>
  </div>
</template>
<script type="text/javascript">
import AddressSelect from '../components/Address/Address'
import FieldSelect from '../components/Field/Field.vue'
export default {
  components: {
    AddressSelect,
    FieldSelect
  },
  data() {
    return {
      lawyerName: '',
      lawfirmName: '',
      six: '',
      lawyerSex: '',
      phone: '',
      year: '',
      individualResume: '',
      uploader: null,
      photoUrl: '',
      province: '',
      state: '',
      area: '',
      cA: '',
      cB: '',
      cC: ''

    }
  },
  mounted() {
    this.getLawDetails()
  },
  methods: {
    getLawDetails() {
      this.$http.get('/memberLawyer/query/lawyerInfoById', {
        params: {
          id: this.$route.query.id
        }
      }).then((data) => {
        if (data.data.httpCode === 200) {
          this.lawyerName = data.data.data.lawyerName
          if (data.data.data.lawyerSex === 0) {
            this.six = '男'
          }
          if (data.data.data.lawyerSex === 1) {
            this.six = '女'
          }
          this.phone = data.data.data.phone
          if (data.data.data.address) {
            this.province = data.data.data.address.split(',')[0]
            this.state = data.data.data.address.split(',')[1]
            this.area = data.data.data.address.split(',')[2]
          }
          this.lawfirmName = data.data.data.firmName
          this.year = data.data.data.careerYear
          this.individualResume = data.data.data.individualResume
          this.photoUrl = data.data.data.lawyerPic
          let fieldArr = data.data.data.field.split(';')
          this.cA = fieldArr[0]
          this.cB = fieldArr[1]
          this.cC = fieldArr[2]
        } else {
          this.$toasted.show(data.data.msg)
        }
      }).catch((err) => {
          console.log(err)
      })
    }
  }
}

</script>
<style type="text/css" scoped>
.container {
  margin-top: 20px;
}

.min-height {
  min-height: 507px;
}

.box-title a {
  color: #a5a5a5;
}

ul {
  padding: 0 0 70px 190px;
}

ul li {
  padding: 10px 0;
}

ul li span {
  width: 194px;
  display: inline-block;
  text-align: right;
  color: #666666;
  margin-right: 20px;
}

textarea {
  width: 350px;
  height: 140px;
  padding: 10px;
}

button {
  margin-right: 45px;
}

.lawyer-info ul {
  padding-bottom: 70px;
}

.lawyer-info ul li {
  padding: 10px 0;
}

.lawyer-info ul li span {
  width: 194px;
  display: inline-block;
  text-align: right;
  color: #666666;
  margin-right: 20px;
}

select {
  width: 121px;
  height: 35px;
}

.remark {
  width: 403px;
  color: #a5a5a5;
}

.upload-css {
  background-color: #888888;
  border: 1px solid #2a508c;
  width: 121px;
  height: 40px;
  color: #000000;
  cursor: pointer;
}

.upload-btn {
  left: -154px;
  top: 0;
  cursor: pointer;
  width: 151px;
}

.icon-asterisk {
  position: relative;
  right: 35px;
  color: #ec5303;
  font-size: 25px;
  top: 3px;
}

.preview-box {
  margin-left: 217px;
  margin-top: 10px;
}

.preview {
  width: 120px;
  height: 120px;
  border: 1px solid #cccccc;
  margin-right: 70px;
}

.input-w1 {
  width: 385px;
}

.p {
  color: #666;
}

.preview div {
  width: 100px;
  height: 100px;
  border-radius: 100%;
  border: 1px solid #cccccc;
  margin-top: 10px;
  line-height: 100px;
  color: #ccc;
}

.preview-img {
  width: 300px;
}

.preview-img img {
  width: 150px;
  height: auto;
}

.button button {
  width: 150px;
  line-height: 35px;
  margin-right: 25px;
}

.field-box {
  display: inline-block;
  overflow: hidden;
}

textarea {
  width: 380px;
  height: 230px;
  padding: 10px 8px;
}

input::-webkit-input-placeholder {
  color: #a5a5a5;
}
</style>
